Kameleon-Plus  0.3.2
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
ccmc::FileReader Class Referenceabstract

TODO: Brief description of FileReader class. More...

#include <ccmc/FileReader.h>

Inheritance diagram for ccmc::FileReader:
Inheritance graph
[legend]
Collaboration diagram for ccmc::FileReader:
Collaboration graph
[legend]

Public Member Functions

 FileReader ()
 
long open (const std::string &filename, bool readonly=true)
 
virtual std::vector< float > * getVariable (const std::string &variable)=0
 
virtual std::vector< float > * getVariable (long variableID)=0
 
virtual std::vector< float > * getVariable (const std::string &variable, long startIndex, long count)=0
 
virtual std::vector< float > * getVariable (long variableID, long startIndex, long count)=0
 
virtual float getVariableAtIndex (const std::string &variable, long index)=0
 
virtual float getVariableAtIndex (long variable_id, long index)=0
 
virtual std::vector< int > * getVariableInt (const std::string &variable)=0
 
virtual int getVariableIntAtIndex (const std::string &variable, long index)=0
 
virtual int getNumberOfGlobalAttributes ()=0
 
virtual int getNumberOfVariables ()=0
 
virtual int getNumberOfVariableAttributes ()=0
 
virtual long getNumberOfRecords (const std::string &variable)=0
 
virtual long getNumberOfRecords (long variable_id)=0
 
virtual long getVariableID (const std::string &variable)=0
 
virtual std::string getVariableName (long variable_id)=0
 
virtual Attribute getGlobalAttribute (long i)=0
 
virtual std::string getGlobalAttributeName (long attribute_id)=0
 
virtual std::string getVariableAttributeName (long attribute_id)=0
 
virtual Attribute getGlobalAttribute (const std::string &attribute)=0
 
virtual long getGlobalAttributeID (const std::string &attribute)=0
 
virtual Attribute getVariableAttribute (const std::string &variable, const std::string &attribute)=0
 
virtual std::vector< std::string > getVariableAttributeNames ()=0
 
virtual bool doesAttributeExist (const std::string &attribute)=0
 
virtual bool doesVariableExist (const std::string &variable)=0
 
void addVariableName (const std::string &variable, long id)
 
long close ()
 
virtual const std::string & getCurrentFilename ()=0
 
virtual void initializeVariableIDs ()=0
 
virtual void initializeVariableNames ()=0
 
virtual long closeFile ()=0
 
virtual long openFile (const std::string &filename, bool readonly)=0
 
virtual ~FileReader ()
 

Static Public Attributes

static const long OK = 0L
 
static const long OPEN_ERROR = -1L
 
static const long FILE_DOES_NOT_EXIST = -2L
 
static const long VARIABLE_DOES_NOT_EXIST = -3L
 
static const long ATTRIBUTE_DOES_NOT_EXIST = -4L
 
static const long LOAD_FAILED = -5L
 
static const long UNABLE_TO_ALLOCATE_MEMORY = -6L
 
static const long VARIABLE_NOT_IN_MEMORY = -7L
 
static const long MODEL_NOT_SUPPORTED = -8L
 
static const long NOT_A_VALID_KAMELEON_FILE = -9L
 

Protected Member Functions

void initializeGlobalAttributes ()
 
void initializeVariableAttributes ()
 

Protected Attributes

std::string current_filename
 
int numGAttributes
 
int numVAttributes
 
boost::unordered_map
< std::string, long > 
variableIDs
 
boost::unordered_map< long,
std::string > 
variableNames
 
boost::unordered_map
< std::string, Attribute
gAttributes
 
boost::unordered_map< long,
Attribute
gAttributeByID
 
boost::unordered_map
< std::string,
boost::unordered_map
< std::string, Attribute > > 
vAttributes
 

Detailed Description

TODO: Brief description of FileReader class.

TODO: Full description of FileReader class

Constructor & Destructor Documentation

ccmc::FileReader::FileReader ( )

Default constructor. Does nothing.

ccmc::FileReader::~FileReader ( )
virtual

Destructor

Member Function Documentation

void ccmc::FileReader::addVariableName ( const std::string &  variable,
long  id 
)
long ccmc::FileReader::close ( )

Closes the currently selected file.

Returns
Status of close operation.
virtual long ccmc::FileReader::closeFile ( )
pure virtual

Implemented in ccmc::CDFFileReader.

virtual bool ccmc::FileReader::doesAttributeExist ( const std::string &  attribute)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual bool ccmc::FileReader::doesVariableExist ( const std::string &  variable)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual const std::string& ccmc::FileReader::getCurrentFilename ( )
pure virtual

Implemented in ccmc::CDFFileReader.

virtual Attribute ccmc::FileReader::getGlobalAttribute ( long  i)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual Attribute ccmc::FileReader::getGlobalAttribute ( const std::string &  attribute)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual long ccmc::FileReader::getGlobalAttributeID ( const std::string &  attribute)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual std::string ccmc::FileReader::getGlobalAttributeName ( long  attribute_id)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual int ccmc::FileReader::getNumberOfGlobalAttributes ( )
pure virtual

Implemented in ccmc::CDFFileReader.

virtual long ccmc::FileReader::getNumberOfRecords ( const std::string &  variable)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual long ccmc::FileReader::getNumberOfRecords ( long  variable_id)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual int ccmc::FileReader::getNumberOfVariableAttributes ( )
pure virtual

Implemented in ccmc::CDFFileReader.

virtual int ccmc::FileReader::getNumberOfVariables ( )
pure virtual

Implemented in ccmc::CDFFileReader.

virtual std::vector<float>* ccmc::FileReader::getVariable ( const std::string &  variable)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual std::vector<float>* ccmc::FileReader::getVariable ( long  variableID)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual std::vector<float>* ccmc::FileReader::getVariable ( const std::string &  variable,
long  startIndex,
long  count 
)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual std::vector<float>* ccmc::FileReader::getVariable ( long  variableID,
long  startIndex,
long  count 
)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual float ccmc::FileReader::getVariableAtIndex ( const std::string &  variable,
long  index 
)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual float ccmc::FileReader::getVariableAtIndex ( long  variable_id,
long  index 
)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual Attribute ccmc::FileReader::getVariableAttribute ( const std::string &  variable,
const std::string &  attribute 
)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual std::string ccmc::FileReader::getVariableAttributeName ( long  attribute_id)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual std::vector<std::string> ccmc::FileReader::getVariableAttributeNames ( )
pure virtual

Implemented in ccmc::CDFFileReader.

long ccmc::FileReader::getVariableID ( const std::string &  variable)
pure virtual

Returns the variable ID as a long. Using the variable ID wherever possible is significantly faster than the equivalent methods accepting the variable string.

Returns
Status of the file operation.

Implemented in ccmc::CDFFileReader.

virtual std::vector<int>* ccmc::FileReader::getVariableInt ( const std::string &  variable)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual int ccmc::FileReader::getVariableIntAtIndex ( const std::string &  variable,
long  index 
)
pure virtual

Implemented in ccmc::CDFFileReader.

virtual std::string ccmc::FileReader::getVariableName ( long  variable_id)
pure virtual

Implemented in ccmc::CDFFileReader.

void ccmc::FileReader::initializeGlobalAttributes ( )
protected

Helper method to store the global attributes in a map. This solves some issues with threaded operations on CDF files.

void ccmc::FileReader::initializeVariableAttributes ( )
protected

Here is the call graph for this function:

virtual void ccmc::FileReader::initializeVariableIDs ( )
pure virtual

Implemented in ccmc::CDFFileReader.

virtual void ccmc::FileReader::initializeVariableNames ( )
pure virtual

Implemented in ccmc::CDFFileReader.

long ccmc::FileReader::open ( const std::string &  filename,
bool  readonly = true 
)
Parameters
filename
Returns
The CDF status of the open call. CDF_OK is the standard successful status.
virtual long ccmc::FileReader::openFile ( const std::string &  filename,
bool  readonly 
)
pure virtual

Implemented in ccmc::CDFFileReader.

Member Data Documentation

const long ccmc::FileReader::ATTRIBUTE_DOES_NOT_EXIST = -4L
static
std::string ccmc::FileReader::current_filename
protected
const long ccmc::FileReader::FILE_DOES_NOT_EXIST = -2L
static
boost::unordered_map<long, Attribute> ccmc::FileReader::gAttributeByID
protected
boost::unordered_map<std::string, Attribute> ccmc::FileReader::gAttributes
protected
const long ccmc::FileReader::LOAD_FAILED = -5L
static
const long ccmc::FileReader::MODEL_NOT_SUPPORTED = -8L
static
const long ccmc::FileReader::NOT_A_VALID_KAMELEON_FILE = -9L
static
int ccmc::FileReader::numGAttributes
protected
int ccmc::FileReader::numVAttributes
protected
const long ccmc::FileReader::OK = 0L
static
const long ccmc::FileReader::OPEN_ERROR = -1L
static
const long ccmc::FileReader::UNABLE_TO_ALLOCATE_MEMORY = -6L
static
const long ccmc::FileReader::VARIABLE_DOES_NOT_EXIST = -3L
static
const long ccmc::FileReader::VARIABLE_NOT_IN_MEMORY = -7L
static
boost::unordered_map<std::string, long> ccmc::FileReader::variableIDs
protected
boost::unordered_map<long, std::string> ccmc::FileReader::variableNames
protected
boost::unordered_map<std::string, boost::unordered_map<std::string, Attribute> > ccmc::FileReader::vAttributes
protected

The documentation for this class was generated from the following files: